package com.Impl;

import com.dao.productDao;
import com.entity.product;
import com.service.productService;
import com.util.DataBaseUtil;

import java.sql.Connection;
import java.util.List;

public class productServiceImpl implements productService {
  @Override
  public List<product> findAll() {
    List<product> list =null;
    Connection con = null;
    try {
      con = DataBaseUtil.getCon();
      productDao productDao = new productDaoImpl(con);
      list = productDao.findAll();
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      DataBaseUtil.closeAll(con,null,null);
    }
    return list;
  }

  @Override
  public boolean addProduct(product product) {
    return false;
  }
}
